package com.devilvan.betrice.lol.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serial;
import java.io.Serializable;

/**
 * @author Evad.Wu
 * @Description LOL-对局荣誉信息 映射
 * @date 2022-09-30
 */
@Setter
@Getter
@ToString
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "LOL_BATTLE_HONOUR")

@Entity
@Table(name = "LOL_BATTLE_HONOUR")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "LOL-对局荣誉信息 映射")
public class LolBattleHonourPo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = 5300113792982898079L;
    @Schema(description = "对局ID")
    @TableField(value = "GAME_ID")
    @Column(name = "GAME_ID", columnDefinition = "BIGINT(19) NOT NULL COMMENT '对局ID'")
    private Long gameId;
    @Schema(description = "QQ号")
    @TableField(value = "OPEN_ID")
    @Column(name = "OPEN_ID", columnDefinition = "VARCHAR(64) NOT NULL COMMENT 'QQ号'")
    private String openId;
    @Schema(description = "是否双杀")
    @TableField(value = "IS_DOUBLE_KILLS")
    @Column(name = "IS_DOUBLE_KILLS", columnDefinition = "BIT(1) COMMENT '是否双杀'")
    private Boolean isDoubleKills;
    @Schema(description = "是否三杀")
    @TableField(value = "IS_TRIPLE_KILLS")
    @Column(name = "IS_TRIPLE_KILLS", columnDefinition = "BIT(1) COMMENT '是否三杀'")
    private Boolean isTripleKills;
    @Schema(description = "是否四杀")
    @TableField(value = "IS_QUADRA_KILLS")
    @Column(name = "IS_QUADRA_KILLS", columnDefinition = "BIT(1) COMMENT '是否四杀'")
    private Boolean isQuadraKills;
    @Schema(description = "是否五杀")
    @TableField(value = "IS_PENTA_KILLS")
    @Column(name = "IS_PENTA_KILLS", columnDefinition = "BIT(1) COMMENT '是否五杀'")
    private Boolean isPentaKills;
    @Schema(description = "是否超神")
    @TableField(value = "IS_GOD_LIKE")
    @Column(name = "IS_GOD_LIKE", columnDefinition = "BIT(1) COMMENT '是否超神'")
    private Boolean isGodLike;
    @Schema(description = "是否补刀最多")
    @TableField(value = "IS_LARGEST_ALL_ALL_MINIONS_KILLED")
    @Column(name = "IS_LARGEST_ALL_ALL_MINIONS_KILLED", columnDefinition = "BIT(1) COMMENT '是否补刀最多'")
    private Boolean isLargestAllAllMinionsKilled;
    @Schema(description = "是否助攻最多")
    @TableField(value = "IS_LARGEST_ASSISTS")
    @Column(name = "IS_LARGEST_ASSISTS", columnDefinition = "BIT(1) COMMENT '是否助攻最多'")
    private Boolean isLargestAssists;
    @Schema(description = "是否最多击杀")
    @TableField(value = "IS_LARGEST_CHAMPIONS_KILLED")
    @Column(name = "IS_LARGEST_CHAMPIONS_KILLED", columnDefinition = "BIT(1) COMMENT '是否最多击杀'")
    private Boolean isLargestChampionsKilled;
    @Schema(description = "是否打钱最多")
    @TableField(value = "IS_LARGEST_GOLD_EARNED")
    @Column(name = "IS_LARGEST_GOLD_EARNED", columnDefinition = "BIT(1) COMMENT '是否打钱最多'")
    private Boolean isLargestGoldEarned;
    @Schema(description = "是否伤害最高")
    @TableField(value = "IS_LARGEST_TOTAL_DAMAGE_DEALT_TO_CHAMPIONS")
    @Column(name = "IS_LARGEST_TOTAL_DAMAGE_DEALT_TO_CHAMPIONS", columnDefinition = "BIT(1) COMMENT '是否伤害最高'")
    private Boolean isLargestTotalDamageDealtToChampions;
    @Schema(description = "是否承受最多伤害")
    @TableField(value = "IS_LARGEST_TOTAL_DAMAGE_TAKEN")
    @Column(name = "IS_LARGEST_TOTAL_DAMAGE_TAKEN", columnDefinition = "BIT(1) COMMENT '是否承受最多伤害'")
    private Boolean isLargestTotalDamageTaken;
    @Schema(description = "是否推塔最多")
    @TableField(value = "IS_LARGEST_TURRETS_KILLED")
    @Column(name = "IS_LARGEST_TURRETS_KILLED", columnDefinition = "BIT(1) COMMENT '是否推塔最多'")
    private Boolean isLargestTurretsKilled;
    @Schema(description = "是否以少胜多")
    @TableField(value = "IS_WIN_WITH_LESS_TEAMMATE")
    @Column(name = "IS_WIN_WITH_LESS_TEAMMATE", columnDefinition = "BIT(1) COMMENT '是否以少胜多'")
    private Boolean isWinWithLessTeammate;
    @Schema(description = "是否一次不死")
    @TableField(value = "IS_ZERO_DEATH")
    @Column(name = "IS_ZERO_DEATH", columnDefinition = "BIT(1) COMMENT '是否一次不死'")
    private Boolean isZeroDeath;
    @Schema(description = "是否MVP")
    @TableField(value = "IS_MVP")
    @Column(name = "IS_MVP", columnDefinition = "BIT(1) COMMENT '是否MVP'")
    private Boolean isMvp;
    @Schema(description = "是否SVP")
    @TableField(value = "IS_SVP")
    @Column(name = "IS_SVP", columnDefinition = "BIT(1) COMMENT '是否SVP'")
    private Boolean isSvp;

    @Schema(description = "对局英雄信息")
    @TableField(exist = false)
    @OneToOne(targetEntity = LolBattleChampionPo.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumns(value = {
            @JoinColumn(name = "GAME_ID", referencedColumnName = "GAME_ID", insertable = false, updatable = false),
            @JoinColumn(name = "OPEN_ID", referencedColumnName = "OPEN_ID", insertable = false, updatable = false)
    })
    private LolBattleChampionPo lolBattleChampionPo;
}
